package com.huixuebao.exchange.controller.login;


import com.huixuebao.common.bean.ApiResult;
import com.huixuebao.exchange.dto.LoginDTO;
import com.huixuebao.exchange.dto.SmsCodeDTO;
import com.huixuebao.exchange.service.LoginService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/exchangeApi/login")
public class LoginController {

    @Autowired
    LoginService loginService;


    /**
     * 登陆理赔平台
     * @param loginDTO
     * @return
     */
    @PostMapping("/login")
    public ApiResult Login(@RequestBody LoginDTO loginDTO){
        return loginService.login(loginDTO);
    }

    /**
     * @author fatao_yu
     * 获取短信验证码
     * @param smsCodeDTO
     * @return
     */
    @PostMapping("/getSmsCode")
    public ApiResult getSmsCode(@RequestBody SmsCodeDTO smsCodeDTO){
        return loginService.getSmsCode(smsCodeDTO);
    }
}
